$(function(){
    imgSrcToggle();//调用函数
    var h = $("#carousel-example-generic").height();
    $("#canvas").height(h);
    var w = $("#carousel-example-generic").width();
    $("#canvas").width(w);
})

//经过图片更改图片src

function imgSrcToggle(){
    $(".xiutu-box-content img").attr("src","img/CamerRaw.png");
    var imgArray = ["img/CameraRaw.png","img/Photoshop.png","img/Lightroom.png","img/RAW.png","img/PsBrush.png"];
    var imgArrayNew = ["img/Photoshop.png","img/Lightroom.png","img/RAW.png","img/PsBrush.png","img/CameraRaw.png"];


    var imgElements = $(".xiutu-box-content img");

    for(var i = 0;i < imgArray.length;i++){
        imgElements.eq(i).attr("src",imgArray[i]);
    }

    imgElements.hover(function () {
            // over
            //得到当前鼠标经过图片的序号
            var i = imgElements.index(this);
            imgElements.eq(i).attr("src",imgArrayNew[i]);
        }, function () {
            // out
            var i = imgElements.index(this);
            imgElements.eq(i).attr("src",imgArray[i]);
        }
    );
}